package com.tang.controller;

import com.tang.entity.Blog;
import com.tang.service.BlogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author tmh
 * @date 2022/12/3 16:01
 * @description 控制层
 */
@RestController
@RequestMapping("get")
public class caculate {
    @Resource
    BlogService blogService;

    @GetMapping("/dbid")
    public Blog selectById(@RequestParam int id) {
        return blogService.selectById(id);
    }

    @GetMapping("/list")
    public List<Blog> list() {
        System.out.println(1);
        return blogService.list();
    }
}
